<?php
/**
 * CompleXml Framework
 *
 * @category   CompleXml
 * @package    CompleXml_Handler
 * @copyright  Copyright (c) 2008 Andrey Kucherenko
 * @license    New BSD License
 * @version    0.1
 */

require_once 'CompleXml/Handler/Output/Abstract.php';
class CompleXml_Handler_Output_Xml extends CompleXml_Handler_Output_Abstract {
	
	public function execute(CompleXml_Object_Abstract $Object) {
		
		if (! ($Object instanceof CompleXml_Object_HttpModel)) {
			throw new CompleXml_Object_Exception ( 'Object not HttpModel' );
		}
		
		$xmlString = $Object->View->getXml ();
		$xml = new DomDocument ( );
		$xml->loadXML ( $xmlString );
		@$xml->xinclude ();
		header ( "Content-type: application/xml" );
		echo $xml->saveXML ();
	
	}
}